package stream第二遍.demo06;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/6 12:32
 */

public class Test {
    public static void main(String[] args) {
    List<Wql> list = new ArrayList<>();
        list.add(new Wql("只因",23,"中"));
        list.add(new Wql("太没",15,"美"));
        list.add(new Wql("giao",20,"俄"));
        list.add(new Wql("只因蛋",6,"意"));

      //  boolean b = list.stream().allMatch(item -> item.getAge() > 10);
      //  System.out.println("b = " + b);

        boolean b1 = list.stream().anyMatch(item -> item.getAge() > 20);
        System.out.println("b1 = " + b1);

    }
}
class  Wql{
    private String name;
    private Integer age;
    private String country;

    public Wql(String name, Integer age, String country) {
        this.name = name;
        this.age = age;
        this.country = country;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    @Override
    public String toString() {
        return "Wql{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", country='" + country + '\'' +
                '}';
    }
}


